import React from 'react';
import { Cascader } from 'antd';

interface Option {
  value: string | number;
  label: string;
  children?: Option[];
}

interface Props {
  options: Option[],
  change: (value: any) => void;
  defaultValue: any[]
}

const CustomCascader: React.FC<Props> = (props) => {
  const { options, change, defaultValue } = props;
  const onChange = (value: (string | number)[]) => {
    change(value);
  };

  return (
    <Cascader defaultValue={defaultValue} options={options} onChange={onChange} placeholder="请选择" />
  )
};

export default CustomCascader;
